var data = [
    { "ID": "Plan01", "EnergyType": "天然气(m³)", "RealTimeQty": "100", "DayQty": "100", "ReferenceQty": "100", "DayProgress": "60", "WeekQty": "100", "MonthQty": "100", "QuarterQty": "100", "YearQty": "100" },
    { "ID": "Plan02", "EnergyType": "柴油(m³)", "RealTimeQty": "200", "DayQty": "100", "ReferenceQty": "100", "DayProgress": "50", "WeekQty": "100", "MonthQty": "100", "QuarterQty": "100", "YearQty": "100" },
    { "ID": "Plan03", "EnergyType": "淡水(m³)", "RealTimeQty": "200", "DayQty": "100", "ReferenceQty": "100", "DayProgress": "70", "WeekQty": "100", "MonthQty": "100", "QuarterQty": "100", "YearQty": "100" },
    { "ID": "Plan04", "EnergyType": "电力(kWh)", "RealTimeQty": "200", "DayQty": "100", "ReferenceQty": "100", "DayProgress": "40", "WeekQty": "100", "MonthQty": "100", "QuarterQty": "100", "YearQty": "100" }
];

// 用户ID
let id = getUrlParam("id");
$(function () {
    GetUserRole();
});
//获取用户权限
function GetUserRole() {
    // let thisdata = [];
    // thisdata.push(InitRole(id));
    let USERdata = InitRole(id);
    if (USERdata != null) {
        InitData();
    }
    else OpenErrmsg("../../web/errhtml/404.html");
}

function InitData() {
    $('#dg_WorkPlanList').datagrid({
        data: data
    });
}
function formaterProgress(value, row) {
    //进度在后台算好 百分比
    let progress = value;
    let text = "";
    if (value > 20) text = value + "%";
    return "<div class='proparent'><div class='prochild' style='width:" + progress + "%;'>" + text + "</div></div>"
}

